package me.send.data.service.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import me.send.business.base.Pager;
import me.send.data.service.mapper.ActivityMapper;
import me.send.data.service.pojo.ActivityFundPool;
import me.send.data.service.pojo.ActivityFundPoolLog;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ActivityService {
    @Autowired
    private ActivityMapper activityMapper;
    
   
    // 使用分页查询
    public List<ActivityFundPoolLog> list(String fundCode,
    		Integer activityType, String start, String end,Pager page) {
    	Map<String, Object> parameter = new HashMap<String, Object>();
    	parameter.put("fundCode", fundCode);
    	parameter.put("activityType", activityType);
    	parameter.put("start", start);
    	parameter.put("end", end);
    	parameter.put("page", page);
    	List<ActivityFundPoolLog> rows = activityMapper.list(parameter);
    	return rows;
    }
    
    // 使用分页查询
    public List<ActivityFundPool> list_pool(String fundCode,
    		Integer status, String start, String end,Pager page) {
    	Map<String, Object> parameter = new HashMap<String, Object>();
    	parameter.put("fundCode", fundCode);
    	parameter.put("status", status);
    	parameter.put("start", start);
    	parameter.put("end", end);
    	parameter.put("page", page);
    	List<ActivityFundPool> rows = activityMapper.list_pool(parameter);
    	return rows;
    }
    // 使用分页查询
    public Integer count_pool(String fundCode,
    		Integer status, String start, String end) {
    	Map<String, Object> parameter = new HashMap<String, Object>();
    	parameter.put("fundCode", fundCode);
    	parameter.put("status", status);
    	parameter.put("start", start);
    	parameter.put("end", end);
    	Integer rows = activityMapper.count_pool(parameter);
    	return rows;
    }
    // 使用分页查询
    public Integer count(String fundCode,
    		Integer activityType, String start, String end) {
    	Map<String, Object> parameter = new HashMap<String, Object>();
    	parameter.put("fundCode", fundCode);
    	parameter.put("activityType", activityType);
    	parameter.put("start", start);
    	parameter.put("end", end);
    	Integer rows = activityMapper.count(parameter);
    	return rows;
    }
    
    
   
}
